<?php /*
	
*/ ?>
<?php
include("system/config.inc.php");
if(isset($_SESSION['memberid']) && ($_SESSION['memberid'])!="") {
	$userid=$_SESSION['memberid'];
	$sql = "select * from tblcustomers where intcusid ='$userid'";
	$result = $n02586916_db->select($sql);
	if($result)
	{
		foreach($result as $row)
				{
					$email1 = $row['varcustemail'];
					$fname1 = $row['varcustfname'];
					$lname1 = $row['varcustlname'];
					$birthdate1 = $row['dtdob'];
					$sex = $row['charcustsex'];
					$p_add=$row['varhouseno'];
					$p_add2=$row['varstreetname'];
					$p_add1=$p_add.",".$p_add2;
					
					$p_code=$row['varpostalcode'];
					$p_city=$row['varcity'];
					$p_state=$row['varstate'];
					$p_coun=$row['varcountry'];
					//die();
					//$radiobutton = $row[''];
					$phoneno1 = $row['varcustphone'];
					$faxno1 = $row['varcustfax'];
					//$action=2;
				}
	}
	//$insert="INSERT INTO `tblcustomeradd` ( `intcustomerid` , `varcustomername` , `varcustomercompanyname` , `varcustomerstreetaddress` , `varcustomercity` , `varcustomerpostcode` , `varcustomerstate` , `varcustomercountry` , `varcustomertelephone` , `varcustomeremailid` ,`vardeliveryname`,`vardeliverycompany`,`vardeliverystreetaddress`,`vardeliverycity`,`vardeliverypostcode`,`vardeliverystate`,`vardeliverycountry`,`varbillingstreetaddress`,`varbillingcity`,`varbillingpostcode`,`varbillingstate`,`varbillingcountry`,`dtfinished`)	VALUES ('$userid', '$fname1', '0','$p_add1', '$p_city', '$p_code', '$p_state', '$p_coun', '$phoneno1','$email1','fname1','0','$p_add1','$p_city','$p_code','$p_state','$p_coun','$p_add1','$p_city','$p_code','$p_state','$p_coun',NOW())";
			//$sqlin=$n02586916_db->insert($insert);
			
			//$id=mysql_insert_id();
			//$_SESSION['order']=$id;
			header("location:checkpersonaldetail.php");
			die();
}

if(isset($_SESSION['custid']) && ($_SESSION['custid'])!="") {
	//print_r($_REQUEST);
	$custid = $_SESSION['custid'];
	//echo $custid;
	$sql = "select * from tblcustomers where intcusid ='$custid'";
	$result = $n02586916_db->select($sql);
	if($result)
	{
		foreach($result as $row)
				{
					$email1 = $row['varcustemail'];
					$fname1 = $row['varcustfname'];
					$lname1 = $row['varcustlname'];
					$birthdate1 = $row['dtdob'];
					$sex = $row['charcustsex'];
					$p_add=$row['varhouseno'];
					$p_add2=$row['varstreetname'];
					$p_add1=$p_add.",".$p_add2;
					$p_code=$row['varpostalcode'];
					$p_city=$row['varcity'];
					$p_state=$row['varstate'];
					$p_coun=$row['varcountry'];
					//die();
					//$radiobutton = $row[''];
					$phoneno1 = $row['varcustphone'];
					$faxno1 = $row['varcustfax'];
					//$action=2;
				}
	}
	//$insert="INSERT INTO `tblcustomeradd` ( `intcustomerid` , `varcustomername` , `varcustomercompanyname` , `varcustomerstreetaddress` , `varcustomercity` , `varcustomerpostcode` , `varcustomerstate` , `varcustomercountry` , `varcustomertelephone` , `varcustomeremailid` ,`vardeliveryname`,`vardeliverycompany`,`vardeliverystreetaddress`,`vardeliverycity`,`vardeliverypostcode`,`vardeliverystate`,`vardeliverycountry`,`varbillingstreetaddress`,`varbillingcity`,`varbillingpostcode`,`varbillingstate`,`varbillingcountry`,`dtfinished`)	VALUES ('$userid', '$fname1', '0','$p_add1', '$p_city', '$p_code', '$p_state', '$p_coun', '$phoneno1','$email1','fname1','0','$p_add1','$p_city','$p_code','$p_state','$p_coun','$p_add1','$p_city','$p_code','$p_state','$p_coun',NOW())";
	//		$sqlin=$n02586916_db->insert($insert);
		header("location:checkpersonaldetail.php");
		die();
	
}
?>
